package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.RankingBoardConf;
import com.sc.nft.entity.dto.RankingListScreenDTO;
import com.sc.nft.entity.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 排行榜配置表(sc_ranking_board_conf)数据Mapper
 *
 * @author Sun
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2023-08-03 16:44:17
 */
@Mapper
public interface RankingBoardConfMapper extends BaseMapper<RankingBoardConf> {

    /**
     * 根据类型获取排行榜列表
     *
     * @param page
     * @param type
     * @return
     */
    Page<PageRankingBoardListByIncomeTypeVO> getPageRankingBoardListByIncomeType(Page page, @Param("type") Integer type);

    /**
     * 分页获取排行榜数据
     *
     * @param page
     * @param type
     * @return
     */
    Page<PageRankingBoardListByTypeVO> getPageRankingBoardListByType(Page page, @Param("type") int type, @Param("name") String name, @Param("beginTime") String beginTime,
                                                                     @Param("endTime") String endTime, @Param("linkCollectonName") String linkCollectonName, @Param("isEnable") Integer isEnable);

    /**
     * 根据类型获取最新的排行筛选
     *
     * @param rankingListScreenDTO
     * @return
     */
    List<RankingListScreenVO> rankingListScreen(@Param("rankingListScreenDTO") RankingListScreenDTO rankingListScreenDTO);

    /**
     * 根据类型获取历史的排行筛选
     *
     * @param rankingListScreenDTO
     * @return
     */
    List<RankingListScreenVO> historyRankingListScreen(@Param("rankingListScreenDTO") RankingListScreenDTO rankingListScreenDTO);

    List<RanKingVO> getRanKing(@Param("linkCollectionId") Long linkCollectionId, @Param("minimumQuantity") Integer minimumQuantity, @Param("listNumber") Integer listNumber, @Param("rankingBoardConfId") Long rankingBoardConfId);

    List<MallRanking> mallRanking(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("listNumber") Integer listNumber, @Param("minimumQuantity") Integer minimumQuantity, @Param("rankingBoardConfId") Long rankingBoardConfId);

    BigDecimal getIpMallTradingProfit(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    Integer getTotalHoldCount(@Param("linkCollectionId") Long linkCollectionId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("beginSection") Integer beginSection, @Param("endSection") Integer endSection);

    BigDecimal individualTurnover(@Param("userId") Long userId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    BigDecimal turnover(@Param("beginSection") Integer beginSection, @Param("endSection") Integer endSection, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    List<RanKingVO> getNewRanKing(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("linkCollectionId") Long linkCollectionId, @Param("minimumQuantity") Integer minimumQuantity, @Param("listNumber") Integer listNumber, @Param("rankingBoardConfId") Long rankingBoardConfId);
    Integer getBeginAndEndTotalHoldCount(@Param("linkCollectionId") Long linkCollectionId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("beginSection") Integer beginSection, @Param("endSection") Integer endSection);

}
